package com.lbd.loan.dao;

import com.lbd.loan.bean.Loan;
import org.springframework.data.domain.Example;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.io.Serializable;
import java.util.List;

/**
 * Created by wang on 2016/9/22.
 */
public interface LoanRepository extends PagingAndSortingRepository<Loan, Serializable>, JpaSpecificationExecutor<Loan> {
    /**
     * @param name
     * @return
     */
    List<Loan> findByAppName(String name);

    /**
     * 根据电话查询借款信息
     *
     * @param mobile
     * @return
     */
    List<Loan> findByAppMobile(String mobile);

    /**
     * 根据电话,姓名查询借款信息
     *
     * @param mobile
     * @param name
     * @return
     */
    List<Loan> findByAppNameAndAppMobile(String name, String mobile);

    /**
     * @param of
     * @return
     */
    List<Loan> findAll(Example<Loan> of);


}
